package com.qf.util;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;

/*
杨威
2022/1/17
20:59
*/
//返回一个连接 用于操控es
public class ConnectionUtil {
    public static RestHighLevelClient getClient(){
        HttpHost httpHost=new HttpHost("10.9.27.69",9200);
        RestClientBuilder builder = RestClient.builder(httpHost);
        RestHighLevelClient client = new RestHighLevelClient(builder);
        return client;
    }
}
